vulkan: Handle changing window scale
authorMatthias Clasen <mclasen@redhat.com>
Sat, 28 Oct 2017 15:57:53 +0000 (11:57 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 28 Oct 2017 15:57:53 +0000 (11:57 -0400)
The code that checks for the proper size of the our swapchain
was not taking window scale fully into account. With this change,
setting the window scale to 2 in the inspector causes the window
to grow and rendering to be scaled up as expected, with Vulkan,
in the same way it already is with cairo.

gdk/gdkvulkancontext.c

index 8b6ffa66ec0096f0e7f8d5db80d6fde10b14d11c..f44253479e84a3380dc79cceaecc483156562804 100644 (file)
@@ -195,8 +195,8 @@ gdk_vulkan_context_check_swapchain (GdkVulkanContext  *context,
   VkDevice device;
   guint i;
 
-  if (gdk_window_get_width (window) == priv->swapchain_width &&
-      gdk_window_get_height (window) == priv->swapchain_height)
+  if (gdk_window_get_width (window) * gdk_window_get_scale_factor (window) == priv->swapchain_width &&
+      gdk_window_get_height (window) * gdk_window_get_scale_factor (window) == priv->swapchain_height)
     return TRUE;
 
   device = gdk_vulkan_context_get_device (context);